package com.lcf.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.UUID;

/**
 * Created by lancf on 2019/4/26.
 */
@Repository
public class UserDao {

    @Autowired
    public JdbcTemplate jdbcTemplate;

    public void addUser(String name,int age){
        String sql="insert into t_user(id,name,age) values(?,?,?)";
        String id= UUID.randomUUID().toString().replace("-","");
        int update = jdbcTemplate.update(sql,id, name, age);

        System.out.println("插入数据------>"+update);
    }

}
